package com.xx.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 3489309323@qq.com
 * @create 2020-06-01-17:47
 */

@WebServlet("/test")
public class TestServlet extends HttpServlet {
  @Override
  protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    System.out.println("test servlet");
    //转发跳转 index.jsp
    req.getRequestDispatcher("/index.jsp").forward(req, resp);
  }

  //↓因为不是在test/ 下 而我们pom中又因为junit是<scope>test</scope> 故这里会报错
  /*@Test
  public void test(){

  }*/
}
